import { TOTAL_VALUE, EXTRA_FIELD } from "@antv/s2";
export const s2DataConfig = {
    fields: {
      rows: ['province', 'city'],//行头
      columns: ['type'],//列头
      values: ['price'],
    },
    data: [
      {
        province: "浙江",
        city: "杭州",
        type: "笔",
        price: "1",
      },
      {
        province: "浙江",
        city: "杭州",
        type: "纸张",
        price: "2",
      },
      {
        province: "浙江",
        city: "舟山",
        type: "笔",
        price: "17",
      },
      {
        province: "浙江",
        city: "舟山",
        type: "纸张",
        price: "6",
      },
      {
        province: "吉林",
        city: "长春",
        type: "笔",
        price: "8",
      },
      {
        province: "吉林",
        city: "白山",
        type: "笔",
        price: "12",
      },
      {
        province: "吉林",
        city: "长春",
        type: "纸张",
        price: "3",
      },
      {
        province: "吉林",
        city: "白山",
        type: "纸张",
        price: "25",
      },
      {
        province: "浙江",
        city: "杭州",
        type: "笔",
        cost: "0.5",
      },
      {
        province: "浙江",
        city: "杭州",
        type: "纸张",
        cost: "20",
      },
      {
        province: "浙江",
        city: "舟山",
        type: "笔",
        cost: "1.7",
      },
      {
        province: "浙江",
        city: "舟山",
        type: "纸张",
        cost: "0.12",
      },
      {
        province: "吉林",
        city: "长春",
        type: "笔",
        cost: "10",
      },
      {
        province: "吉林",
        city: "白山",
        type: "笔",
        cost: "9",
      },
      {
        province: "吉林",
        city: "长春",
        type: "纸张",
        cost: "3",
      },
      {
        province: "吉林",
        city: "白山",
        type: "纸张",
        cost: "1",
      }
    ],
    sortParams:[
      {
        // province 依据（ province - 小计 ）&（ 总计 - price ）& 升序 排序
        sortFieldId: 'province',
        sortMethod: 'DESC',
        sortByMeasure: TOTAL_VALUE,
        query: {
          [EXTRA_FIELD]: 'price',
        },
      }
    ]
    
  };
  export const defaultSortParams = [
    { sortFieldId: 'province', sortMethod: 'DESC' },
    { sortFieldId: 'type', sortBy: ['纸张', '笔'] },
    {
      sortFieldId: 'city',
      sortByMeasure: 'price',
      sortMethod: 'DESC',
    },
  ];